home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / MSG Demo 1.4 / source / Demo ƒ / demo crash.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  1.7 KB  |  60 lines  |  [TEXT/KAHL]

  1. /**********************************************************************\
  2.  
  3. File:        demo crash.c
  4.  
  5. Purpose:    This module handles crashing your machine with grace and
  6.             style.
  7.  
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12.  
  13. This program is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. GNU General Public License for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with this program in a file named "GNU General Public License".
  20. If not, write to the Free Software Foundation, 675 Mass Ave,
  21. Cambridge, MA 02139, USA.
  22.  
  23. \**********************************************************************/
  24.  
  25. #include "demo crash.h"
  26. #include "demo.h"
  27. #include "sounds.h"
  28. #include "environment.h"
  29. #include "main.h"
  30.  
  31. void RestoreScreen(int oldMenuHeight)
  32. {
  33.     TextFont(0);
  34.     TextSize(0);
  35.     TextMode(srcOr);
  36.     FlushEvents(mDownMask+mUpMask+keyDownMask+keyUpMask+autoKeyMask, 0L);
  37.     MBarHeight=oldMenuHeight;
  38.     DrawMenuBar();
  39.     PaintOne(0L,GrayRgn);
  40.     PaintBehind(WindowList,GrayRgn);
  41.     ShowCursor();
  42.     ObscureCursor();
  43. }
  44.  
  45. void CrashAndBurn(int whichSystemError)
  46. {
  47.     int                oldMenuHeight;
  48.     int                whichWipe;
  49.     
  50.     DoSound(sound_crash, FALSE);
  51.     
  52.     ShutDownEnvironment();        /* If you have to crash a computer, */
  53.                                 /* it costs nothing to be polite. */
  54.     SysError(whichSystemError);
  55.     
  56.     whichWipe=(Ticks&0x7fffffff)%NUM_WIPES;
  57.     DoFullScreenFade(whichWipe+1);
  58.     ExitToShell();
  59. }
  60.